<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>VUE绑定事件</title>
        <script type="text/javascript" src="https://unpkg.com/vue/dist/vue.js"></script>
    </head>
    <body>
        <div id="app">
        <input v-model="message"/><br/>
            <p>{{message}}</p>
            <button @click="message = '-----' + message + '-----'">计算表达式</button>
            <button @click="hello">调用方法[方式1]</button>
            <button @click="sayHello('zhj')">调用方法[方式2]</button>
        </div>
    </body>
    <script type="text/javascript">
        var vueObj = new Vue({
            el: '#app',
            data: {
                message: ""
            },
            methods: {
                hello: function(event) {
                    console.log("触发了hello方法，event：" + event);
                },
                sayHello: function(name) {
                    console.log("触发了sayHello方法，event：" + event);
                    console.log("你好，" + name);
                }
            }
        });
    </script>
</html>